#!/bin/sh
tar zxvf onig-5.9.1.tar.gz
patch onig-5.9.1/regenc.h < ./patch/regenc.h.patch 

cd ./onig-5.9.1
./configure
make

cd ../src
gcc -Wall -fPIC -O2 -I../onig-5.9.1 -c onigvw.c ptrreg.c
gcc -shared -Wl,-soname,libonigvw.so.3 -o ../libonigvw.so.3.0.0 onigvw.o ../onig-5.9.1/.libs/libonig.a ptrreg.o
